package com.lottery.ruok.lottrey.adapter;

import android.content.Context;
import android.view.View;

import com.lottery.ruok.lottrey.retrofitModule.response.GetPayTypeResponse;
import com.lottery.ruok.lottrey.ui.component.ChargeItemView;

import java.util.List;

public class ChargeItemsAdapter extends BaseListAdapter<GetPayTypeResponse.GetPayItemsResponse> {
    private String title;

    public ChargeItemsAdapter(Context context) {
        super(context);
    }


    @Override
    protected View createItemView(Context mContext) {
        ChargeItemView view = new ChargeItemView(mContext);
        view.setTitle(title);
        return view;
    }

    @Override
    protected void onBindView(View itemView, int position) {
        if (itemView instanceof ChargeItemView) {
            ChargeItemView view = (ChargeItemView) itemView;
            view.setData(getList().get(position));
        }
    }

    public void setList(List<GetPayTypeResponse.GetPayItemsResponse> list, String title) {
        this.title = title;
        super.setList(list);
    }
}
